package com.xc.stock.dto.model;

import java.math.BigDecimal;
import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.xc.stock.constant.AccountActionEnum;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class AccountOperParam {
	/**
	 * 是否可以为负数
	 */
	boolean allowNegative;
	AccountActionEnum accountAction;
	String outerUid;
	String outerNo;
	String logContent;
	JSONObject logExt;

	BigDecimal stampTax;
	BigDecimal commission;
	BigDecimal recharge;
	BigDecimal preTradingDay;
	BigDecimal withdrawAmount;

	Integer agentId;
	Integer agentMemberId;
	String agentMemberNo;
	DestInfo agent;
	DestInfo member;
	
	/**
	 * 当卖出的时候 改比金额能不能立即提现
	 * 
	 * 具体 T1, T2具体考试 Utils.calcSettlementDate
	 */
	Date limitWithrawAt;
	
	public boolean hasLimitWithraw() {
		return accountAction == AccountActionEnum.TRUST_SELL && limitWithrawAt != null && limitWithrawAt.after(new Date());
	}
}
